package com.lc.rongzecaifu;

import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;

import com.bumptech.glide.request.target.ViewTarget;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.lc.rongzecaifu.rongzecaifu.R;
import com.tencent.bugly.crashreport.CrashReport;
import com.zcx.helper.app.AppApplication;
import com.zcx.helper.http.Http;
import com.zcx.helper.scale.ScaleScreenHelper;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

/**
 * Created by Administrator on 2/16/2016.
 */


public class MyApplication extends AppApplication {

    public static ScaleScreenHelper scaleScreenHelper;

    public static MyPreferences myPreferences;



    public static boolean canClean = true;

    @Override
    public void onCreate() {
        super.onCreate();
        Fresco.initialize(this);
//        Helper.Initialize(this, "荣泽财富");
        myPreferences = new MyPreferences(this, "rzcf");
        scaleScreenHelper = ScaleScreenHelperFactory.create(this, 720);

        CrashReport.initCrashReport(getApplicationContext(), "c24ccaf117", false);

        Http.getInstance().setIsLog(true);
        Http.getInstance().setOnStartEndCreateDialog(new Http.OnStartEndCreateDialog() {

            @Override
            public Dialog onCreate(Context context) {
                ProgressDialog progressDialog = new ProgressDialog(context);
                progressDialog.setCancelable(false);
                return progressDialog;
            }

            @Override
            public void show(Dialog dialog) {
                dialog.show();
            }

            @Override
            public void dismiss(Dialog dialog) {
                dialog.dismiss();
            }

        });

        ViewTarget.setTagId(R.id.glide_tag);
//        GlideLoader.getInstance().init(this, R.mipmap.ic_launcher);
    }

}
